import '@/App.css';
import React from 'react'
import { BrowserRouter as Router,Switch } from "react-router-dom";
import pages from '@/pages/index'
import  routes from "@/routes/index";
import  FancyRoute from "@/routes/FancyRoute";
import Layout from '@/components/Layout'
class  App extends React.Component{
  constructor(props){
    super(props)
    this.state={}
  }
  render() {
    return (
      <Router>
        <Layout>
        <Switch>
          <FancyRoute exact path="/" component={pages.Home}></FancyRoute>
          {
            routes.map(e=>(
              <FancyRoute path={e.path} key={e.key} component={pages[e.key]}></FancyRoute>
            ))
          }
        </Switch>
        </Layout>
      </Router>
    ); 
  }
  
}

export default App;
